
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controladores;
import Clases.Planificacion;
import java.util.List;
import javax.persistence.EntityManagerFactory;
/**
 *
 * @author Bryan
 */
public class PlanificacionPersonalizada extends PlanificacionJpaController{
    public PlanificacionPersonalizada(EntityManagerFactory emf){
        super(emf);
    }

    public Short GenerarId(){
        List<Planificacion> todos = this.findPlanificacionEntities();
        if(todos.isEmpty()){
            return 0;
        }
        else{
            return Short.valueOf(String.valueOf(todos.size()));
        }
    }

   /** public List<Planificacion> pBuscarPorCodigoPersonal(String cod){
       EntityManager em = super.getEntityManager();
       return em.createQuery("").getResultList();
    }
    public int UltimoId(){
        EntityManager em = super.getEntityManager();
        List<Planificacion> todos = em.createQuery("").getResultList();
        if(todos.isEmpty()){
            return 0;
        }else{
            Planificacion ultimo = todos.get(todos.size()-1);
            return ultimo.getIdPlanificacion();
        }
    }
    public List<Planificacion> pTodosLosAlumnos(){
        EntityManager em = super.getEntityManager();
        return em.createQuery("").getResultList();
    }
    public List<Planificacion> pAlumnosHabilitados(){
        EntityManager em = super.getEntityManager();
        return em.createQuery("").getResultList();
    }
    public List<Planificacion> pAlumnosDeshabilitados(){
        EntityManager em = super.getEntityManager();
        return em.createQuery("").getResultList();
    }
**/
}
